home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 April / ME_2011_04.iso / [Video-Tutorial] / start.swf / scripts / frame_1 / DoAction_5.as < prev    next >
Encoding:
Text File  |  2010-10-14  |  12.9 KB  |  349 lines

  1. function renderVideoDataArray(nodes_array, depth_array)
  2. {
  3.    var _loc1_ = 0;
  4.    while(_loc1_ < nodes_array.length)
  5.    {
  6.       depth_array[depth_array.length - 1] += 1;
  7.       var _loc5_ = depth_array.join(".") + ".";
  8.       nodes_array[_loc1_].attributes.index = _loc5_;
  9.       if(nodes_array[_loc1_].attributes.type == "movie")
  10.       {
  11.          var _loc3_ = new Object();
  12.          _loc3_.chapter_id = _loc5_;
  13.          _loc3_.movie_name = nodes_array[_loc1_].attributes.name;
  14.          _loc3_.movie = nodes_array[_loc1_].attributes.movie;
  15.          if(nodes_array[_loc1_].attributes.movie2 != undefined && nodes_array[_loc1_].attributes.movie2 != "")
  16.          {
  17.             _loc3_.movie2 = nodes_array[_loc1_].attributes.movie2;
  18.          }
  19.          video_array.push(_loc3_);
  20.       }
  21.       if(nodes_array[_loc1_].hasChildNodes())
  22.       {
  23.          renderVideoDataArray(nodes_array[_loc1_].childNodes,depth_array.concat([0]));
  24.       }
  25.       _loc1_ = _loc1_ + 1;
  26.    }
  27.    if(depth_array.length == 1)
  28.    {
  29.       notifyDebugger("After RenderVideoDataArray");
  30.       openApplication();
  31.    }
  32. }
  33. function renderSettings()
  34. {
  35.    if(client_os == "Windows")
  36.    {
  37.       mdm.Forms.SplashForm.callFunction("output","Rendering settings..","");
  38.    }
  39.    var _loc2_ = settings.firstChild.childNodes[0];
  40.    while(_loc2_ != null)
  41.    {
  42.       if(_loc2_.firstChild.nodeType == 1)
  43.       {
  44.          _root[_loc2_.nodeName] = _loc2_.childNodes;
  45.       }
  46.       else
  47.       {
  48.          _root[_loc2_.nodeName] = _loc2_.firstChild.nodeValue;
  49.       }
  50.       _loc2_ = _loc2_.nextSibling;
  51.    }
  52.    _loc2_ = styles.firstChild.childNodes[0];
  53.    while(_loc2_ != null)
  54.    {
  55.       _root[_loc2_.nodeName] = _loc2_.firstChild.nodeValue;
  56.       _loc2_ = _loc2_.nextSibling;
  57.    }
  58.    if(default_stage_width > client_res_x)
  59.    {
  60.       default_stage_width = client_res_x;
  61.    }
  62.    if(default_stage_height > client_res_y)
  63.    {
  64.       default_stage_height = client_res_y;
  65.    }
  66.    if(allow_bookmarks != "true")
  67.    {
  68.       tab_bookmarks = undefined;
  69.    }
  70.    tab_arr.push([tab_home,"home_mc",false]);
  71.    tab_arr.push([tab_dvd_content,"dvd_content_mc",false,undefined]);
  72.    tab_arr.push([tab_bookmarks,"bookmarks_mc",false,undefined]);
  73.    tab_arr.push([tab_online,"online_mc",false,undefined]);
  74.    tab_arr.push([tab_help,"help_mc",false,undefined]);
  75.    tab_arr.push([tab_setup,"setup_mc",false,undefined]);
  76.    i = 0;
  77.    while(i < additional_tabs.length)
  78.    {
  79.       tab_arr.push([additional_tabs[i].firstChild.nodeValue,"template_mc" + i,false,additional_tabs[i].attributes.xml_file]);
  80.       i++;
  81.    }
  82.    i = 0;
  83.    while(i < tab_arr.length)
  84.    {
  85.       if(!(tab_arr[i][0] == "" or tab_arr[i][0] == null or tab_arr[i][0] == undefined))
  86.       {
  87.          used_tab_arr.push(tab_arr[i]);
  88.       }
  89.       i++;
  90.    }
  91.    if(moviefolder_1280 == "" or moviefolder_1280 == null or moviefolder_1280 == undefined or moviefolder_1280 == "null" or moviefolder_1280 == "undefined")
  92.    {
  93.       moviefolder_1280 = moviefolder_1024;
  94.    }
  95.    if(moviefolder_1024 == "" or moviefolder_1024 == null or moviefolder_1024 == undefined or moviefolder_1024 == "null" or moviefolder_1024 == "undefined")
  96.    {
  97.       moviefolder_1024 = moviefolder_1280;
  98.    }
  99.    if(max_video_res == 1280)
  100.    {
  101.       moviefolder = moviefolder_1280;
  102.    }
  103.    else if(max_video_res == 1024)
  104.    {
  105.       moviefolder = moviefolder_1024;
  106.    }
  107.    moviepath_info = folder + moviefolder;
  108.    if(wfiles_folder == undefined)
  109.    {
  110.       wfiles_folder = "";
  111.    }
  112.    if(client_res_y <= 768)
  113.    {
  114.       full_video_mode_display = "true";
  115.    }
  116.    if(minimum_stage_height < 500)
  117.    {
  118.       minimum_stage_height = 500;
  119.    }
  120.    if(videojump_ondrag_allowed == "true")
  121.    {
  122.       videojump_ondrag_allowed = true;
  123.    }
  124.    else
  125.    {
  126.       videojump_ondrag_allowed = false;
  127.    }
  128.    apptitle = vendor_name + " - " + app_name;
  129.    application_title_op.autoSize = true;
  130.    application_title_op.text = apptitle;
  131.    mdm.Application.title = apptitle;
  132.    so_name = "v2b" + unique_app_code;
  133.    v2b_so = SharedObject.getLocal(so_name,"/");
  134.    if(v2b_so.data.last_seen_movie)
  135.    {
  136.       last_seen_movie_xml_node = new XML(v2b_so.data.last_seen_movie[0]);
  137.    }
  138.    tmp_header_info = header_start_info;
  139.    if(debug == "true")
  140.    {
  141.       renderDebugger();
  142.    }
  143.    loadContent();
  144. }
  145. function renderDebugger()
  146. {
  147.    test_op._y = 200;
  148.    _root.attachMovie("debug_mc","debug_mc_attached",5500);
  149.    if(debugger_open)
  150.    {
  151.       debug_mc_attached._x = 3;
  152.    }
  153.    else
  154.    {
  155.       debug_mc_attached._x = -200;
  156.    }
  157.    if(_root.useFSP_path == "true")
  158.    {
  159.       debug_mc_attached._y = 43;
  160.    }
  161.    else
  162.    {
  163.       debug_mc_attached._y = 3;
  164.    }
  165.    debug_mc_attached.open_debug_btn_mc.btn_rollover_mc._visible = false;
  166.    debug_mc_attached.open_debug_btn_mc.onRollOver = function()
  167.    {
  168.       this.btn_rollover_mc._visible = true;
  169.    };
  170.    debug_mc_attached.open_debug_btn_mc.onRollOut = function()
  171.    {
  172.       this.btn_rollover_mc._visible = false;
  173.    };
  174.    debug_mc_attached.open_debug_btn_mc.onRelease = function()
  175.    {
  176.       this.btn_rollover_mc._visible = false;
  177.       if(debugger_open)
  178.       {
  179.          _root.debug_mc_attached._x = -200;
  180.          debugger_open = false;
  181.       }
  182.       else
  183.       {
  184.          _root.debug_mc_attached._x = 3;
  185.          debugger_open = true;
  186.       }
  187.    };
  188.    debug_mc_attached.save_bookmarks_btn_mc.btn_rollover_mc._visible = false;
  189.    debug_mc_attached.save_bookmarks_btn_mc.onRollOver = function()
  190.    {
  191.       this.btn_rollover_mc._visible = true;
  192.    };
  193.    debug_mc_attached.save_bookmarks_btn_mc.onRollOut = function()
  194.    {
  195.       this.btn_rollover_mc._visible = false;
  196.    };
  197.    debug_mc_attached.save_bookmarks_btn_mc.onRelease = function()
  198.    {
  199.       this.btn_rollover_mc._visible = false;
  200.       content_pos_mc.video_mc.savePdBookmarks();
  201.    };
  202.    notifyDebugger(master_version);
  203.    notifyDebugger(os_info);
  204.    notifyDebugger(os_string[0]);
  205.    notifyDebugger(fsp_path);
  206. }
  207. function renderMain()
  208. {
  209.    loadClip(fsp_path + folder + bg_image,bg_mc,null,null,"fullfixed",true,undefined,false,true);
  210.    content_pos_mc._visible = false;
  211.    content_pos_mc._x = 0;
  212.    content_pos_mc._y = 0;
  213.    content_pos_mc.attachMovie("content_bg_mc","content_bg_mc",content_pos_mc.getNextHighestDepth());
  214.    content_pos_mc.content_bg_mc._y = 25;
  215.    content_pos_mc.attachMovie("bottom_mc","bottom_mc",content_pos_mc.getNextHighestDepth());
  216.    content_pos_mc.bottom_mc._x = 2;
  217.    content_pos_mc.bottom_mc._y = 2;
  218.    content_pos_mc.bottom_mc.app_header_text_mc.text_op.autoSize = true;
  219.    content_pos_mc.bottom_mc.app_header_text_mc.text_op.text = app_name;
  220.    content_pos_mc.bottom_mc.app_header_reflex_mc.text_op.autoSize = true;
  221.    content_pos_mc.bottom_mc.app_header_reflex_mc.text_op.text = app_name;
  222.    content_pos_mc.bottom_mc.header_reflexion_mc._width = Math.round(content_pos_mc.bottom_mc.app_header_reflex_mc.text_op._width + 10);
  223.    content_pos_mc.bottom_mc.createEmptyMovieClip("logo_bottom_holder_mc",1);
  224.    loadClip(fsp_path + folder + logo_bottom,content_pos_mc.bottom_mc.logo_bottom_holder_mc,null,null,null,false,setPos,false,true);
  225.    content_pos_mc.attachMovie("tab_navigation_mc","tab_navigation_mc",content_pos_mc.getNextHighestDepth());
  226.    content_pos_mc.tab_navigation_mc._y = 0;
  227.    content_pos_mc.tab_navigation_mc.attachMovie("tab_navigation_bg_mc","tab_navigation_bg_mc",content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  228.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._height = 25;
  229.    i = 0;
  230.    while(i < used_tab_arr.length)
  231.    {
  232.       content_pos_mc.tab_navigation_mc.attachMovie("tab_navigation_item_mc","tab_item_mc" + i,content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  233.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].item_id = i;
  234.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_rollover_mc._visible = false;
  235.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op._x = 20;
  236.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.autoSize = true;
  237.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.textColor = parseColor(tabnavigator_text_color);
  238.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.text = used_tab_arr[i][0].toUpperCase();
  239.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.textWidth + 47);
  240.       if(i == 0)
  241.       {
  242.          content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._x = 2;
  243.       }
  244.       else
  245.       {
  246.          content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._x = Math.round(content_pos_mc.tab_navigation_mc["tab_item_mc" + (i - 1)]._x + content_pos_mc.tab_navigation_mc["tab_item_mc" + (i - 1)]._width + 2);
  247.       }
  248.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._y = 2;
  249.       drawBox(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_rollover_mc,content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width,23,parseColor(tabnavigator_rollover_color),parseColor(tabnavigator_rollover_color),100,100,"linear");
  250.       drawBox(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc,content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width,25,parseColor(tabnavigator_pressed_color),parseColor(tabnavigator_pressed_color),100,100,"linear");
  251.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRollOver = function()
  252.       {
  253.          this.tab_navigation_item_rollover_mc._visible = true;
  254.       };
  255.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRollOut = content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onReleaseOutside = function()
  256.       {
  257.          this.tab_navigation_item_rollover_mc._visible = false;
  258.       };
  259.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRelease = function()
  260.       {
  261.          renderContent(this.item_id);
  262.       };
  263.       i++;
  264.    }
  265.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc._width + 2);
  266.    content_pos_mc.attachMovie("content_panel_mc","content_panel_mc",content_pos_mc.getNextHighestDepth());
  267.    notifyDebugger("Before ASB Init");
  268.    AsBroadcaster.initialize(content_pos_mc.content_panel_mc);
  269.    notifyDebugger("After ASB Init");
  270.    content_pos_mc.content_panel_mc._x = 2;
  271.    content_pos_mc.content_panel_mc._y = 27;
  272.    content_pos_mc.createEmptyMovieClip("content_mc",content_pos_mc.getNextHighestDepth());
  273.    content_pos_mc.content_mc._x = 2;
  274.    content_pos_mc.content_mc._y = 27;
  275.    content_pos_mc.attachMovie("video_mc","video_mc",content_pos_mc.getNextHighestDepth());
  276.    content_pos_mc.video_mc._x = 2;
  277.    content_pos_mc.video_mc._y = 52;
  278.    content_pos_mc.attachMovie("mct_mc","mct_mc",content_pos_mc.getNextHighestDepth());
  279.    content_pos_mc.mct_mc._x = 0;
  280.    if(full_video_mode_display == "true")
  281.    {
  282.       content_pos_mc.mct_mc._y = 27;
  283.    }
  284.    else
  285.    {
  286.       content_pos_mc.mct_mc._y = 52;
  287.    }
  288.    setPos();
  289.    loadClip(fsp_path + folder + "vcore.swf",content_pos_mc.video_mc,null,null,null,false,false,false,false,true,initializeStage);
  290. }
  291. function initializeStage()
  292. {
  293.    rendercontent_delay = setTimeout(renderContent,250,0);
  294. }
  295. function renderContent(arg)
  296. {
  297.    if(content_pos_mc._visible == false)
  298.    {
  299.       content_pos_mc._visible = true;
  300.    }
  301.    if(video_mode)
  302.    {
  303.       if(mct_mode)
  304.       {
  305.          killMCT();
  306.       }
  307.       else if(content_pos_mc.video_mc.flv_player_state == "stopped")
  308.       {
  309.          killMovie();
  310.       }
  311.       else
  312.       {
  313.          pauseMovie();
  314.       }
  315.    }
  316.    i = 0;
  317.    while(i < used_tab_arr.length)
  318.    {
  319.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  320.       content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].text_op.textColor = parseColor(tabnavigator_text_color);
  321.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  322.       if(used_tab_arr[i][2])
  323.       {
  324.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  325.       }
  326.       i++;
  327.    }
  328.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].tab_navigation_item_rollover_mc._visible = false;
  329.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].tab_navigation_item_active_mc._visible = true;
  330.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].text_op.textColor = parseColor(tabnavigator_text_pressed_color);
  331.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].enabled = false;
  332.    if(used_tab_arr[arg][2])
  333.    {
  334.       content_pos_mc.content_mc[used_tab_arr[arg][1]].setVisibility(true);
  335.    }
  336.    else if(used_tab_arr[arg][3])
  337.    {
  338.       content_pos_mc.content_mc.attachMovie("template_mc",used_tab_arr[arg][1],arg);
  339.       content_pos_mc.content_mc[used_tab_arr[arg][1]].xml_file = used_tab_arr[arg][3];
  340.       used_tab_arr[arg][2] = true;
  341.    }
  342.    else
  343.    {
  344.       content_pos_mc.content_mc.attachMovie(used_tab_arr[arg][1],used_tab_arr[arg][1],arg);
  345.       used_tab_arr[arg][2] = true;
  346.    }
  347.    last_visible_content = arg;
  348. }
  349.